/*
 * RemoveMarcadorAction.java
 *
 * Created on 12 de noviembre de 2007, 9:17
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package webportlet.model.portletfacade.plain.action;

import java.sql.Connection;
import webportlet.model.marcador.dao.SQLMarcadorDAO;
import webportlet.model.marcador.dao.SQLMarcadorDAOFactory;
import webportlet.model.marcador.dto.MarcadorDTO;
import webportlet.model.util.DuplicateInstanceException;
import webportlet.model.util.InstanceNotFoundException;
import webportlet.model.util.InternalErrorException;
import webportlet.model.portletfacade.util.PasswordEncrypter;
import webportlet.model.util.TransactionalPlainAction;

/**
 *
 * @author Alvarete
 */
public class RemoveMarcadorAction implements TransactionalPlainAction {

    
    private MarcadorDTO marcadorDTO;

    public RemoveMarcadorAction(MarcadorDTO marcadorDTO) {
        
        this.marcadorDTO = marcadorDTO;
    }
        

    public Object execute(Connection connection) 
        throws InstanceNotFoundException, DuplicateInstanceException, 
               InternalErrorException {
                
        SQLMarcadorDAO marcadorDAO = SQLMarcadorDAOFactory.getDAO();
        marcadorDAO.remove(connection, marcadorDTO.getId());
            
        return null;            
    }    
}
